<?php
$loader->requireOnce('includes/RadConnector/InPatientRadConnector.class.php');
$loader->requireOnce('includes/RadConnector/OutPatientRadConnector.class.php');
class RadConnectorFactory {
    public static function createConnector($patientType) {
        switch ($patientType) {
        	case Utils::getEnumKey(EnumerationConstant::PATIENT_TYPE,
                    EnumerationConstant::PATIENT_TYPE_INPATIENT):
        		return new InPatientRadConnector();
            case Utils::getEnumKey(EnumerationConstant::PATIENT_TYPE,
                    EnumerationConstant::PATIENT_TYPE_OUTPATIENT):
                return new OutPatientRadConnector();
            default:
            	throw new CoreException("The patient type [patientType=$patientType] is not supported", CoreErrorCode::PATIENT_TYPE_NOT_SUPPORTED);
        }
    }
}
?>